import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userInfo:{},
    menus:[],
  },
  getters: {
    getUserInfo:state=>state.userInfo,
    getMenus:state=>state.menus,
  },
  mutations: {
    setUserInfo(state, res) {
      state.userInfo = res
    },
    setMenus(state, res) {
      state.menus = res
    },
  },
  actions: {
    asyncAddCount(context) {
      setTimeout(() => {
        context.commit('addCount');
      }, 1500)
    }
  },
  modules: {}
})